from django.conf import settings

import aioredis

host = settings.REDIS.get("host")
port = settings.REDIS.get("port")
password = settings.REDIS.get("password")


async def create_connection():
    return await aioredis.create_connection('redis://{0}:{1}'.format(host, port),
                                            password=password,
                                            db=0, encoding='utf-8')


async def create_connection_pool():
    return await aioredis.create_pool('redis://{0}:{1}'.format(host, port),
                                      password=password,
                                      db=0, encoding='utf-8')
